package com.hmall.api.client.fallback;

import com.hmall.api.client.OrderClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

@Slf4j
public class OrderClientFallbackFactory implements FallbackFactory<OrderClient> {
    @Override
    public OrderClient create(Throwable cause) {
        return orderId -> {
            log.error("订单状态修改失败，订单id：{}",orderId,cause);
            throw new RuntimeException("订单状态修改失败");
        };
    }
}
